package org.example.springboot.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author 莫磊
 * @date 2025/8/16
 * @description 将配置文件中的值绑定到指定类中
 */
@Data
@Component
@ConfigurationProperties(prefix = "jdbc")
// 指定读取的配置文件
@PropertySource("classpath:config/jdbc.yaml")
public class JdbcConfig {

    private String url;
    private String username;
    private String password;
    private String driverClassName;

}
